package com.example.moduletwo.delegate;

import android.text.TextUtils;
import android.widget.TextView;

import com.example.moduletwo.R;
import com.example.mvp.delegate.BaseAppDelegate;

/**
 * 视图改变托管类
 * Created by sun.li on 2018/6/5.
 *
 * @author sun.li
 */

public class ModuleTwoMVPActivityDelegate extends BaseAppDelegate implements TwoMVPDelegate{
    @Override
    protected int initLayoutRes() {
        return R.layout.activity_mvp_module_two;
    }

    @Override
    public void initWidget() {
        setText1("按钮①初始化值");
        setText2("按钮②初始化值");
    }

    /** 设置文本框1的内容*/
    public void setText1(String str){
        if(!TextUtils.isEmpty(str)){
            TextView textView1 = getView(R.id.tv_amvp_text_1);
            textView1.setText(str);
        }
    }

    /** 设置文本框2的内容*/
    public void setText2(String str){

        if(!TextUtils.isEmpty(str)){
            TextView textView2 = getView(R.id.tv_amvp_text_2);
            textView2.setText(str);
            textView2.setBackgroundResource(R.mipmap.ic_launcher);
        }
    }

    @Override
    public void getText() {

    }
}
